<%@ page language="java" contentType="text/html; charset=UTF-8" pageEncoding="UTF-8"%>
<%@ taglib uri="/tag/sys" prefix="sys"%>
<%@ taglib uri="http://java.sun.com/jsp/jstl/core" prefix="c"%>
<html>
<head>
<base href="<sys:baseUrl/>">
	<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
	<title>编辑新闻</title>
	<script type="text/javascript" charset="utf-8" src="kindeditor/kindeditor.js"></script>
	<link rel="stylesheet" href="admin/style/common.css" type="text/css" />
	<script type="text/javascript" src="js/floatDiv.js"></script>
	<script type="text/javascript" src="js/floatDiv.js"></script>
	<link rel="stylesheet" href="style/floatDiv.css" type="text/css" />
	<link rel="stylesheet" href="admin/style/news.css" type="text/css" />
	<script type="text/javascript">
	KE.show({
		id : 'content',
		imageUploadJson : '<sys:baseUrl/>/kindeditor/upload',
		fileManagerJson : '<sys:baseUrl/>/kindeditor/action/file_manager_json.jsp',
		allowFileManager : true,
		afterCreate : function(id) {
			KE.event.ctrl(document, 13, function() {
				KE.util.setData(id);
				document.forms['news'].submit();
			});
			KE.event.ctrl(KE.g[id].iframeDoc, 13, function() {
				KE.util.setData(id);
				document.forms['news'].submit();
			});
		},
		resizeMode : 0,
		shadowMode : false,
		allowPreviewEmoticons : true,
		urlType : 'absolute',
		newlineTag : 'br',
		items : ['source', '|', 'fullscreen', 'undo', 'redo', 'print', 'cut', 'copy', 'paste',
		         'plainpaste', 'wordpaste', '|', 'justifyleft', 'justifycenter', 'justifyright',
		         'justifyfull', 'insertorderedlist', 'insertunorderedlist', 'indent', 'outdent', 'subscript',
		         'superscript', '|', 'selectall', '-',
		         'title', 'fontname', 'fontsize', '|', 'textcolor', 'bgcolor', 'bold',
		         'italic', 'underline', 'strikethrough', 'removeformat', '|', 'image',
		         'flash', 'media', 'advtable', 'hr', 'emoticons', 'link', 'unlink','|', 'about']
	});
	</script>
</head>
<body style="height: 95%">
<div class="center" style="width:800px;">
	<div id="tips">
	<c:if test="${message==null}">
		试一试<a href="admin/news/edit/${sp.name }/picture">相册新闻</a>吧，获得更好的展示效果
	</c:if>
	<c:if test="${message!=null}">
		${message}
	</c:if>
	</div>
	<form name="news" method="post" action="admin/update/news/${sp.name }/text">
		<input type="hidden" name="id" value="${news.id }"/>
		<label>新闻标题：<input name="title" size="40" value="${news.title }"/></label>
		<label>新闻分类：
		<select name="sort">
		<c:forEach items="${sp.sorts }" var="sps">
			<c:forEach items="${op.sorts }" var="ops">
				<c:if test="${ops.id==sps.id }">
					<c:if test="${ops.id==news.sort.id }">
						<option value="${ops.id }" selected="selected">${ops.name }</option>
					</c:if>
					<c:if test="${ops.id!=news.sort.id }">
						<option value="${ops.id }">${ops.name }</option>
					</c:if>
				</c:if>
			</c:forEach>
		</c:forEach>
		</select>
		</label>
		<br/><br/>
		<textarea id="content" name="content" cols="100" rows="4" 
			style="width:800px;height:300px;visibility:hidden;">${news.content}</textarea>
		<br /><br/>
		<div id="attach">
			<a href="javascript:void();">上传附件</a>
			<div id="attach_list">
				
			</div>
		</div>
		<div align="center">
			<input type="submit" name="publish" value="发布" />&nbsp;&nbsp;
			<input type="submit" name="save" value="保存草稿" />&nbsp;&nbsp;
			<a href="view/${news.id+0}" target="_blank">
				<input type="button" name="preview" value="预览" /></a>
		</div>
	</form>
</div>
</body>
</html>